const mongoose = require('mongoose')
mongoose.set('debug', true)

const init = async () => {
  await mongoose
  // 'mongodb://root:yinglian@@88AA@localhost:27017/test?authSource=admin'
    .connect('mongodb://47.100.230.202:27071/express?authSource=admin', {
      dbName: 'express',
      user: 'root',
      pass: 'yinglian@@88AA',
      useNewUrlParser: true,
      useCreateIndex: true,
      useFindAndModify: false,
      useUnifiedTopology: true
    })
  console.log('mongodb 连接正常')
}

module.exports = init